home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Keyboard.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
4KB
|
145 lines
{
File: Keyboard.p
Contains: interfaces for keyboard componets
Version: Technology:
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Keyboard;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __KEYBOARD__}
{$SETC __KEYBOARD__ := 1}
{$I+}
{$SETC KeyboardIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __CONDITIONALMACROS__}
{$I ConditionalMacros.p}
{$ENDC}
{$IFC UNDEFINED __EVENTS__}
{$I Events.p}
{$ENDC}
{$IFC UNDEFINED __IOITERATOR__}
{$I IOIterator.p}
{$ENDC}
{$IFC UNDEFINED __TIMING__}
{$I Timing.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{ Virtual ID for a keyboard }
TYPE
KeyboardID = UInt32;
{ System 8.x version of of a Keymap }
KeyboardMap = PACKED ARRAY [0..31] OF Byte;
{ System 8.x version of a virtual key }
VirtualKeyCode = UInt8;
{ System 8.x definition of keyboard modifiers }
KeyboardModifiers = UInt16;
{ System 8.x definition of keyboard direction }
CONST
kKeyDirectionKeyDown = $0001;
kKeyDirectionKeyUp = $0002;
kKeyDirectionAutoKeyDown = $0003;
TYPE
KeyDirection = INTEGER;
KeyboardDeviceMode = UInt32;
{ Keyboard Event returned from I/O subsystem }
LowLevelKeyEventPtr = ^LowLevelKeyEvent;
LowLevelKeyEvent = PACKED RECORD
theBoard: KeyboardID;
theKey: VirtualKeyCode;
filler1: SInt8;
direction: KeyDirection;
modifiers: KeyboardModifiers;
theEventTime: AbsoluteTime;
END;
CONST
kKeyboardHardwareTypeUnknown = 0;
kKeyboardHardwareTypeADB = 1;
kKeyboardHardwareTypeSerial = 2;
TYPE
KeyboardHardwareType = UInt32;
KeyboardIOIteratorDataPtr = ^KeyboardIOIteratorData;
KeyboardIOIteratorData = RECORD
IOCommon: IOCommonInfo;
theType: KeyboardHardwareType;
keycount: UInt32;
kcapResID: UInt32;
hasNumericKeypad: BOOLEAN;
hasLEDFeedback: BOOLEAN;
END;
KeyboardDeviceRecord = KeyboardIOIteratorData;
KeyboardDeviceRecordPtr = ^KeyboardDeviceRecord;
CONST
kKeyboardLEDOff = 0;
kKeyboardLEDOn = 1;
TYPE
KeyboardLEDState = BOOLEAN;
CONST
kKeyboardLEDNumLock = 0;
kKeyboardLEDCapsLock = 1;
kKeyboardLEDScrollLock = 2;
TYPE
KeyboardLEDSelector = INTEGER;
FUNCTION GetKeyMap(theID: KeyboardID; VAR theMap: KeyboardMap): OSStatus; C;
FUNCTION KeyboardIsKeyDown(theKey: ByteParameter; VAR keyState: KeyDirection; VAR modifierState: KeyboardModifiers): OSStatus; C;
{ Warning: This routine is intended only for clients who need to bypass the events system altogether. }
FUNCTION GetNextLowLevelKeyEvent(VAR theKey: LowLevelKeyEvent): OSStatus; C;
FUNCTION GetLastKeypressTime(VAR theTime: AbsoluteTime): OSStatus; C;
FUNCTION GetKeyboardLEDStatus(theID: KeyboardID; theLight: INTEGER; VAR value: BOOLEAN): OSStatus; C;
FUNCTION SetKeyboardLEDStatus(theID: KeyboardID; theLight: INTEGER; value: BOOLEAN): OSStatus; C;
FUNCTION GetKeyboardDeviceMode(theID: KeyboardID; VAR theMode: KeyboardDeviceMode): OSStatus; C;
FUNCTION SetKeyboardDeviceMode(theID: KeyboardID; theMode: KeyboardDeviceMode): OSStatus; C;
{ Device Iteration }
FUNCTION GetKeyboardDeviceRecord(theID: KeyboardID; VAR theDeviceRecord: KeyboardDeviceRecord): OSStatus; C;
FUNCTION KeyboardGetDeviceData(requestItemCount: ItemCount; VAR totalItemCount: ItemCount; VAR iteratorBuffer: KeyboardIOIteratorData): OSStatus; C;
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := KeyboardIncludes}
{$ENDC} {__KEYBOARD__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}